# Contributor: Leon Marz <main@lmarz.org>
# Maintainer: Leon Marz <main@lmarz.org>
pkgname=openimagedenoise
pkgver=1.4.3
pkgrel=1
pkgdesc="Intel Open Image Denoise library"
url="https://www.openimagedenoise.org/"
arch="x86_64" # openimagedenoise only really supports x86_64
license="Apache-2.0"
makedepends="cmake python3 libtbb-dev ispc openimageio-dev samurai"
subpackages="$pkgname-dev $pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/OpenImageDenoise/oidn/releases/download/v$pkgver/oidn-$pkgver.src.tar.gz"
builddir="$srcdir/oidn-$pkgver"
options="!check" # doesn't have a test suite

build() {
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=True \
		-DCMAKE_BUILD_TYPE=Release \
		-DOIDN_APPS=OFF

	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
6fbdf347763c0734140195a523cf0878b1dbd91d4943c9ce4928f6991549f8b3d5ab4d57b90e20a8d04a87d00e3a1554ce73a3a3c1e64fcb016a3c1f8aa07982  openimagedenoise-1.4.3.tar.gz
"
